import { Component } from 'react'
import '../styles/appleItem.scss'
import { observer } from 'mobx-react'

@observer
class AppleItem extends Component {
  render() {
    const { appleItem, eatApple } = this.props
    return (
      <div className='appleItem'>
        <div className='apple'>
          <img src={require('../images/apple.png')} alt='' />
        </div>
        <div className='info'>
          {/* <div className='name'>红苹果 - {appleItem.id}号</div> */}
          <div className='weight'>{appleItem.weight}克</div>
        </div>
        <div className='btn-div'>
          <button onClick={() => eatApple(appleItem)}> 吃掉 </button>
        </div>
      </div>
    )
  }
}

export default AppleItem
